FROM python:3.8.3-alpine3.12

RUN sed -i 's#dl-cdn.alpinelinux.org#mirrors.aliyun.com#' /etc/apk/repositories \
 && apk add gcc g++ make \
 && pip config set global.index-url https://mirrors.aliyun.com/pypi/simple \
 && pip3 install --upgrade pip \
 && pip3 install  setuptools  bson markdown pyaml pyyaml numpy pymongo redis uvloop \
 && pip3 install aiosmtplib \
 && pip3 install tornado \
 && mkdir -p /tmp/build \
 && cd /tmp/build \
 && wget -t 3 https://s.xabcstack.com/files/curl-7.43.0.tar.gz -O -|tar xzf - \
 && cd curl-7.43.0 \
 && ./configure \
 && make \
 && make install \
 && pip3 install pycurl \
 && rm -rf /tmp/build \
 && apk del gcc g++ make

RUN cd /home \
 && wget https://github.com/ywgx/filelist/archive/master.zip \
 && unzip master.zip
 

WORKDIR /home/filelist-master

VOLUME ['/home/filelist-master/files']

EXPOSE 9000

CMD [ "./index.py" ]
